cmake_minimum_required(VERSION 3.10)
project(Project)

# 设置 C++ 标准
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD_REQUIRED True)

# 包含 Eigen 库的路径
find_package(Eigen3 REQUIRED)


# 查找 Python 3 库和 NumPy
find_package(Python3 COMPONENTS Development NumPy)
if(Python3_FOUND AND Python3_NumPy_FOUND)
    message(STATUS "Python3 and NumPy found: ${Python3_EXECUTABLE}")
else()
    message(FATAL_ERROR "Python 3 or NumPy not found")
endif()

# # 为 CubicSplineTest 目标设置包含目录和链接库
# add_executable(CubicSplineTest ./src/test_cubic.cpp)
# target_include_directories(CubicSplineTest PRIVATE ${Python3_INCLUDE_DIRS} ${Python3_NumPy_INCLUDE_DIRS} ./include)
# target_link_libraries(CubicSplineTest ${Python3_LIBRARIES} ${Python3_NumPy_LIBRARIES})

# add_executable(LinearSplineTest test_linear.cpp)
# target_include_directories(LinearSplineTest PRIVATE ${Python3_INCLUDE_DIRS} ${Python3_NumPy_INCLUDE_DIRS})
# target_link_libraries(LinearSplineTest ${Python3_LIBRARIES} ${Python3_NumPy_LIBRARIES})

# add_executable(BSplineTest ./src/test_b.cpp)
# target_include_directories(BSplineTest PRIVATE ${Python3_INCLUDE_DIRS} ${Python3_NumPy_INCLUDE_DIRS} ./include)
# target_link_libraries(BSplineTest ${Python3_LIBRARIES} ${Python3_NumPy_LIBRARIES} Eigen3::Eigen)

add_executable(A ./src/A.cpp)
target_include_directories(A PRIVATE ${Python3_INCLUDE_DIRS} ${Python3_NumPy_INCLUDE_DIRS} ./src/include)
target_link_libraries(A ${Python3_LIBRARIES} ${Python3_NumPy_LIBRARIES} Eigen3::Eigen)

add_executable(C_D ./src/C_and_D.cpp)
target_include_directories(C_D PRIVATE ${Python3_INCLUDE_DIRS} ${Python3_NumPy_INCLUDE_DIRS} ./src/include)
target_link_libraries(C_D ${Python3_LIBRARIES} ${Python3_NumPy_LIBRARIES} Eigen3::Eigen)

add_executable(E ./src/E.cpp)
target_include_directories(E PRIVATE ${Python3_INCLUDE_DIRS} ${Python3_NumPy_INCLUDE_DIRS} ./src/include)
target_link_libraries(E ${Python3_LIBRARIES} ${Python3_NumPy_LIBRARIES} Eigen3::Eigen)

add_executable(F ./src/F.cpp)
target_include_directories(F PRIVATE ${Python3_INCLUDE_DIRS} ${Python3_NumPy_INCLUDE_DIRS} ./src/include)
target_link_libraries(F ${Python3_LIBRARIES} ${Python3_NumPy_LIBRARIES} Eigen3::Eigen)

add_executable(test ./src/MoreTest.cpp)
target_include_directories(test PRIVATE ${Python3_INCLUDE_DIRS} ${Python3_NumPy_INCLUDE_DIRS} ./src/include)
target_link_libraries(test ${Python3_LIBRARIES} ${Python3_NumPy_LIBRARIES} Eigen3::Eigen)